package org.example.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.dao.entity.User;
import org.example.dao.entity.UserThird;
import org.example.dao.mapper.UserMapper;
import org.example.service.UserService;
import org.example.service.UserThirdService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Resource
    private UserThirdService userThirdService;

    @Override
    public void bind(Integer userId, String id, String base64Url) {
        UserThird userThird = new UserThird();
        userThird.setUserId(userId);
        userThird.setCredential(base64Url);
        userThird.setCredentialId(id);
        userThirdService.save(userThird);
    }
}
